﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MeasNetClient
{
    public partial class ConfigForm : Form
    {
        public ConfigForm()
        {
            InitializeComponent();
        }

        private void ConfigForm_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'mNCdataDataSet.Station' table. You can move, or remove it, as needed.
            this.stationTableAdapter.Fill(this.mNCdataDataSet.Station);
        }

        private void stationBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.stationBindingSource.EndEdit();
            this.tableAdapterManager.UpdateAll(this.mNCdataDataSet);
        }


        // CONTROLLING EDIT AND SHOW OF THE PASSWORD COLUMN 
        // EDIT
        //private void stationDataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
        //{
        //    if (e.CellStyle.BackColor == Color.LemonChiffon)
        //    {
        //        TextBox textBox = e.Control as TextBox;
        //        if (textBox != null)
        //        {
        //            textBox.UseSystemPasswordChar = true;
        //        }
        //    }
        //}
        // SHOW
        private void stationDataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            if (e.CellStyle.BackColor == Color.LemonChiffon && e.Value != null)
            {
                e.Value = new string('*', e.Value.ToString().Length); 
               
            }
        }

        ////

    }
}
